﻿@{
  int noReadMailCount = ((List<TBM.Models.Mail>)ViewBag.Mails).Where(a=>!a.MarkRead).Count();  
}
<div class="row">
  <div class="col-md-6">
    <!-- BEGIN PORTLET -->
    <div class="portlet light">
      <div class="portlet-title">
        <div class="caption caption-md">
          <i class="icon-bar-chart theme-font hide"></i>
          <span class="caption-subject font-blue-madison bold uppercase">邮件</span>
          <span class="caption-helper">@noReadMailCount 封未读邮件</span>
        </div>
      </div>
      <div class="portlet-body">
        <div class="scroller" style="height: 320px;" data-always-visible="1" data-rail-visible1="0" data-handle-color="#D7DCE2">
          <div class="general-item-list">
            @foreach(TBM.Models.Mail item in ViewBag.Mails){
            <div class="item">
              <div class="item-head">
                <div class="item-details">
                  <img class="item-pic" src="@item.MailFrom.PicUrl" />
                  <label class="item-name primary-link">@item.MailFrom.FullName</label>
                  <span class="item-label">@TBM.Core.Date.ToText(item.CreateDate)</span>
                </div>
                @if(!item.MarkRead){
                <span class="item-status">
                  <span class="badge badge-empty badge-success"></span>
                </span>
                }
              </div>
              <div class="item-body">
                <a href="~/Mail#@TBM.Core.App.ToBase64("action=/Mail/Reader/&mailbox=inbox&mid=" + item.ID)">@Html.Raw(item.Context)</a>
              </div>
            </div>
            }
          </div>
        </div>
      </div>
      <div class="mt-5 clearfix">
        <div class="btn-arrow-link pull-right">
          <a href="~/Mail">查看所有邮件</a>
        </div>
      </div>
    </div>
    <!-- END PORTLET -->
  </div>
  <div class="col-md-6">
    <!-- BEGIN PORTLET -->
    <div class="portlet light">
      <div class="portlet-title tabbable-line">
        <div class="caption caption-md">
          <i class="icon-globe theme-font hide"></i>
          <span class="caption-subject font-blue-madison bold uppercase">反馈</span>
        </div>
        <ul class="nav nav-tabs">
          <li class="active">
            <a href="#tab_feed_system" data-toggle="tab">系统 </a>
          </li>
        </ul>
      </div>
      <div class="portlet-body">
        <!--BEGIN TABS-->
        <div class="tab-content">
          <div class="tab-pane active" id="tab_feed_system">
            <div class="scroller" style="height: 320px;" data-always-visible="1" data-rail-visible1="0" data-handle-color="#D7DCE2">
              <ul class="feeds">
                @foreach(TBM.Models.Feedback item in ViewBag.SysLog){
                <li>
                  <a href="javascript:;">
                    <div class="col1">
                      <div class="cont">
                        <div class="cont-col1">
                          @switch(item.Type){
                            case 0:{
                              <div class="label label-sm label-info">
                                <i class="fa fa-bullhorn"></i>
                              </div>
                              break;
                            }
                            case 1:{
                              <div class="label label-sm label-warning">
                                <i class="fa fa-bullhorn"></i>
                              </div>
                              break;
                            }
                            case 2:{
                              <div class="label label-sm label-danger">
                                <i class="fa fa-bolt"></i>
                              </div>
                              break;
                            }
                            case 3:{
                              <div class="label label-sm label-success">
                                <i class="fa fa-bell-o"></i>
                              </div>
                              break;
                            }
                          }

                      </div>
                        <div class="cont-col2">
                          <div class="desc">
                            @item.Message
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="col2">
                      <div class="date">
                        @TBM.Core.Date.ToText(item.CreateDate)
                      </div>
                    </div>
                  </a>
                </li>
                }
              </ul>
            </div>
          </div>
        </div>
        <!--END TABS-->
      </div>
      <div class="mt-5 clearfix">
        <div class="btn-arrow-link pull-right">
          <a href="javascript:;">查看所有反馈</a>
        </div>
      </div>
    </div>
    <!-- END PORTLET -->
  </div>
</div>

<script type="text/javascript">
  jQuery(document).ready(function () {
    ProfileOverview.init();
  });
</script>